{% extends "home/content_layout.html" %}

{% block head %}
{{ super() }}
<meta name="description" content="GitHub 上开源、有趣的 {{ page_title }} - 适合新手入门的 {{ page_title }}">
{% endblock %}

{% block content %}
{% for project in projects %}
    <h2 class="content-subhead">
        <a target="_blank" href="{{ project.project_url }}">{{ project.title }}</a>
        {% if project.collected == 1 %}
            <i id="collect_{{ project.id }}" class="fa fa-heart color-blue"></i>
            <span hidden="hidden">{{ project.collected_project_id }}</span>
        {% else %}
            <i id="collect_{{ project.id }}" class="fa fa-heart-o color-blue"></i>
            <span hidden="hidden"></span>
        {% endif %}
    </h2>
    <p>{{ project.description|safe }}
    {% if project.image_url %}
        <br><img style="max-width:100%;" src="{{ project.image_url }}" alt="{{ project.title }}">
    {% endif %}
    </p>
{% endfor %}
<hr/>
{# 翻页 #}
<div class="pure-g">
    <div class="pure-u-1-3">
        {% if 1< current_page <= page_count %}
        <div class="pre">
            <a class="button-small pure-button pure-button-primary" href="/category/{{ category_url }}/?page={{ current_page - 1 }}">上一页</a>
        </div>
        {% endif %}
    </div>
    <div class="pure-u-1-3">
        <div class="social-share" data-sites="weibo,wechat" align="center"></div>
    </div>
    <div class="pure-u-1-3">
        {% if current_page < page_count %}
        <div class="next">
            <a class="button-small pure-button pure-button-primary" href="/category/{{ category_url }}/?page={{ current_page + 1 }}">下一页</a>
        </div>
        {% endif %}
    </div>
</div>
{% endblock %}